package top.vains.entity;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 响应实体
 *
 * @author vains
 * @version 1.0
 * @since 2020/2/18 18:06
 **/
@Data
@NoArgsConstructor
@AllArgsConstructor
@ApiModel("响应实体，统一的响应体")
public class Result<T> {

    /**
     * 响应码
     */
    @ApiModelProperty(value = "响应码", dataType = "Integer", example = "200")
    private Integer code;

    /**
     * 响应信息
     */
    @ApiModelProperty(value = "响应信息", dataType = "String", example = "操作成功")
    private String message;

    /**
     * 响应状态
     */
    @ApiModelProperty(value = "响应状态", dataType = "Boolean", example = "true")
    private Boolean flag;

    /**
     * 响应数据
     */
    @ApiModelProperty(value = "响应数据", dataType = "T", example = "data")
    private T data;

}
